<%--
  Created by IntelliJ IDEA.
  User: 14408
  Date: 2022/1/10
  Time: 12:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>用户分页</title>
    <style>
        table,tr,th,td{
            border: 1px black solid;
        }
    </style>
</head>
<body>
<div  align="center">
    <table >
        <tr>
            <th>id</th>
            <th>姓名</th>
            <th>密码</th>
            <th>年龄</th>
        </tr>
        <C:forEach items="${userList}" var="user">
            <tr>
                <td>${user.id}</td>
                <td>${user.name}</td>
                <td>${user.password}</td>
                <td>${user.age}</td>
            </tr>
        </C:forEach>
        <tr>
            <td colspan="4">
                <a href="/paging/user.do?pageSize=2&pageIndex=1">首页</a>
                <a href="/paging/user.do?pageSize=2&pageIndex=${paging.pageIndex-1}">上一页</a>
                <a href="/paging/user.do?pageSize=2&pageIndex=${paging.pageIndex+1}">下一页</a>
                <a href="/paging/user.do?pageSize=2&pageIndex=${paging.totalPage}">最后一页</a>
            </td>
        </tr>
    </table>
</div>

</body>
</html>
